# -*- coding:utf-8 -*-
class Solution:
    # 返回对应char
    def __init__(self):
        self.strs = dict()
        self.first_char = []
    def FirstAppearingOnce(self):
        # write code here
        return self.first_char[-1] if self.first_char else ''
    def Insert(self, char):
        # write code here
        if char not in self.strs.keys():
            self.strs[char] = 1
            self.first_char.insert(0, char)
        elif self.strs[char] == 1:
            self.strs[char] += 1
            self.first_char.pop(self.first_char.index(char))

            
# -*- coding:utf-8 -*-
class Solution:
    # 返回对应char
    def __init__(self):
        self.count = []
        self.char = []
    def FirstAppearingOnce(self):
        # write code here
        for i in range(len(self.count)):
            if self.count[i] == 1:
                return self.char[i]
        return '#'
    def Insert(self, char):
        # write code here
        if char in self.char:
            self.count[self.char.index(char)] += 1
        else:
            self.count.append(1)
            self.char.append(char)
